package com.ytt.core.service.repository;

import com.ytt.core.service.entity.teacher.Teacher;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface TeacherRepository extends JpaRepository<Teacher, Long>, JpaSpecificationExecutor<Teacher> {
    /**
     * 通过学号查询
     *
     * @param job_number 用户账号
     * @return 用户ID，否则返回null
     */
    @Query("select u.id from Teacher as u where u.job_number = :job_number")
    Long findByJob_number(@Param("job_number") String job_number);
}
